import request from "@/utils/request";

export function login(data) {
  return request({
    url: "platform/user/login",
    method: "post",
    data
  });
}

export function getInfo(token) {
  return request({
    url: "/user/info",
    method: "get",
    params: { token }
  });
}

export function preLogin(data) {
  return request({
    url: `platform/user/preLogin`,
    method: "post",
    data: data
  });
}

export function logout() {
  return request({
    url: "platform/user/logout",
    method: "post"
  });
}

export function register(data) {
  return request({
    url: "userRegister/register",
    method: "post",
    data: data
  });
}
export function updatePwd(data) {
  return request({
    url: "userRegister/updatePwd",
    method: "post",
    data: data
  });
}

export function lostPwd(data) {
  return request({
    url: "userRegister/lostPwd",
    method: "post",
    data: data
  });
}

export function sendCaptcha(data) {
  return request({
    url: "common/sendCaptcha",
    method: "post",
    params: data
  });
}

export function graphVerifyCode(data) {
  return request({
    url: "platform/user/graphVerifyCode/" + data,
    method: "get"
  });
}

// 重置密码
export function changePass(data) {
  return request({
    url: "platform/user/updateUserPassword/",
    method: "post",
    data
  });
}

// 修改密码
export function updatePass(data) {
  return request({
    url: "platform/user/updateUserPassword/",
    method: "post",
    data
  });
}
